package com.novellotus.iov.carvice.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Rich on 2018/1/20.
 */

public class RxFn implements Parcelable {

    /**
     * roleId : NDh2sZH6eHtPUcg2y5ECgf
     * roleName : 自动化运维管理员
     * description : 管理运维团队和运维工单
     * parentId :
     * menus : [{"id":"5L7eM4X1HiKD5PcwkHnoTi","name":"关注车辆","description":"菜单不显示","style":"","childrens":[]},{"id":"FBwSPQWMQZfVoQM5NMqeMt","name":"保养单","description":"整车保养单管理","style":"","childrens":[]},{"id":"SAety7qHf942SbWfz3HvoP","name":"外出救急单","description":"紧急救急单","style":"","childrens":[]},{"id":"XHESLqYwnsXJhAV5p5zhH3","name":"紧急调件单","description":"","style":"","childrens":[]},{"id":"yiL59EK36i28m5U8kzU1k","name":"团队管理","description":"所有功能模块下的团队管理[供应商，整车。国家联调]","style":"","childrens":[{"id":"H6aETriCHJ1RfgrEv236Pv","name":"角色管理","description":"角色管理","style":"","childrens":""},{"id":"V3DRWfcrtFprf6wWdL3snY","name":"添加员工(单个/批量)","description":"添加员工(单个/批量)","style":"","childrens":""},{"id":"4ThsuCGiMqpPMjVkTdTynt","name":"移除员工","description":"移除员工","style":"","childrens":""},{"id":"Q76ShR8RSujN3z2A6dS2Yt","name":"编辑员工信息","description":"","style":"","childrens":""}]},{"id":"2B7zZGgwy5xTGKKSJsZmKw","name":"终端管理","description":"","style":"","childrens":[{"id":"MQVrJsoiibPaAeNiduFJQt","name":"参数设置","description":"2","style":"","childrens":""}]},{"id":"E6VP5fLdn7mSUcdBHq5wBa","name":"车辆出库管理","description":"车辆出库管理","style":"","childrens":[]},{"id":"AVtfsMFUSXTR4SfvgSYpUT","name":"售后业务","description":"整车维修单审核等","style":"","childrens":[]}]
     */

    private String roleId;
    private String roleName;
    private String description;
    private String parentId;
    private List<MenusBean> menus;

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public List<MenusBean> getMenus() {
        return menus;
    }

    public void setMenus(List<MenusBean> menus) {
        this.menus = menus;
    }

    public static class MenusBean implements Parcelable {
        /**
         * id : 5L7eM4X1HiKD5PcwkHnoTi
         * name : 关注车辆
         * description : 菜单不显示
         * style :
         * childrens : []
         */

        private String id;
        private String name;
        private String description;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }


        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.name);
            dest.writeString(this.description);
        }

        public MenusBean() {
        }

        protected MenusBean(Parcel in) {
            this.id = in.readString();
            this.name = in.readString();
            this.description = in.readString();
        }

        public static final Creator<MenusBean> CREATOR = new Creator<MenusBean>() {
            @Override
            public MenusBean createFromParcel(Parcel source) {
                return new MenusBean(source);
            }

            @Override
            public MenusBean[] newArray(int size) {
                return new MenusBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.roleId);
        dest.writeString(this.roleName);
        dest.writeString(this.description);
        dest.writeString(this.parentId);
        dest.writeList(this.menus);
    }

    public RxFn() {
    }

    protected RxFn(Parcel in) {
        this.roleId = in.readString();
        this.roleName = in.readString();
        this.description = in.readString();
        this.parentId = in.readString();
        this.menus = new ArrayList<>();
        in.readList(this.menus, MenusBean.class.getClassLoader());
    }

    public static final Parcelable.Creator<RxFn> CREATOR = new Parcelable.Creator<RxFn>() {
        @Override
        public RxFn createFromParcel(Parcel source) {
            return new RxFn(source);
        }

        @Override
        public RxFn[] newArray(int size) {
            return new RxFn[size];
        }
    };
}
